package top.hcode.hoj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import top.hcode.hoj.pojo.entity.problem.ProblemTag;
import top.hcode.hoj.pojo.entity.problem.Tag;

import java.util.List;

@Mapper
@Repository
public interface ProblemTagMapper extends BaseMapper<ProblemTag> {

    @Select("select * from tag where id in (select tid from problem_tag where pid = #{problemId})")
    List<Tag> queryTagsByProblem(@Param("problemId") Long problemId);

}
